package com.dong.es.entity.searchparam.query.exist;

import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery;

/**
 * @description: Es 查询 存在 参数
 * @author: 陈瑞东
 * @create: 2022-06-23 12:25
 */
public class EsExistParam extends EsExistBaseParam{
    private static final long serialVersionUID = -1903343963574782837L;

    public EsExistParam(String field) {
        super(field);
    }

    @Override
    public void loadTo(BoolQuery.Builder target) {
        target.must(must -> must.exists(exists -> exists.field(field)));
    }
}
